import Cookies from 'js-cookie'
import website from '@/config/website'
const Authorization = website.Authorization
export function getToken() {
  return Cookies.get(Authorization)
}

export function setToken(token, time) {
  let inFifteenMinutes = new Date(time)
  return Cookies.set(Authorization, token, { expires: inFifteenMinutes })
}

export function removeToken() {
  return Cookies.remove(Authorization)
}

export function getSession(key) {
  return sessionStorage.getItem(key);
}
export function setSession(key, val) {
  sessionStorage.setItem(key, val)
}
export function removeSession(key) {
  sessionStorage.removeItem(key);
}
export function clearSession() {
  sessionStorage.clear();
}